
import { _decorator, Component, Label, Animation } from 'cc';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = systemMessage
 * DateTime = Wed May 24 2023 19:18:10 GMT+0800 (GMT+08:00)
 * Author = guoxun
 * FileBasename = systemMessage.ts
 * FileBasenameNoExtension = systemMessage
 * URL = db://assets/script/pop/systemMessage.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */

@ccclass('SystemMessage')
export class SystemMessage extends Component {
    @property(Label)
    mLbContent: Label = null;
    protected onLoad(): void {
        this.node.getComponent(Animation).on(Animation.EventType.FINISHED, () => {
            this.node.destroy();
        })

    }

    protected start(): void {
        this.node.getComponent(Animation).play();
    }

    InitContent(str: string) {
        this.mLbContent.string = str;
    }
}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/decorator.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
 */
